package main

import (
	"discoveries-rpc/api"
	"discoveries-rpc/model"
	"fmt"
	"gitee.com/xuxinzhi2206/corehub/grpc"
	"gitee.com/xuxinzhi2206/corehub/viper"
	grpc2 "google.golang.org/grpc"
)

func main() {
	err := viper.GetViper("./config/config.yaml")
	if err != nil {
		panic(err)
	}
	err = model.AutoMigrate()
	if err != nil {
		panic(err)
	}
	fmt.Print("开始了\n")
	err = grpc.RegisterRPC(func(s *grpc2.Server) {
		api.Register(s)
	})
	if err != nil {
		panic(err)
	}
	fmt.Printf("结束")
}
